package top.maof.book.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.jsoup.Connection;
import top.maof.book.model.Contents;

import java.util.List;

@Mapper
public interface ContentsMapper extends BaseMapper<Contents> {
    int deleteByPrimaryKey(Integer id);

//    int insert(Contents record);

    @Select("select * from contents where url = #{url}")
    Contents findByUrl(String url);

    @Select("select * from contents where book_id = #{bookId} and web_id = #{webId}")
    List<Contents> findByBookIdAndWebId(Integer bookId, Integer webId);

    @Select("select * from contents where book_id = #{bookId}")
    List<Contents> findByBookId(int bookId);

    int insertSelective(Contents record);

    Contents selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Contents record);

    int updateByPrimaryKeyWithBLOBs(Contents record);

    int updateByPrimaryKey(Contents record);
}
